home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 4 / Amiga Tools 4.iso / tools / netzwerk / tcp-ip / amiftp / install_amiftp < prev    next >
Text File  |  1996-02-26  |  20KB  |  497 lines

  1. ;******************************************************************************
  2. ;         ____           __   ______ ______ ______
  3. ;        / __ \         /_/  / ____//_  __// __  /
  4. ;       / /_/ /_   _   __   / /_     / /  / /_/ /
  5. ;      / __  // \_/ \ / /  / __/    / /  / ____/
  6. ;     / / / // /__/ // /_ / /      / /  / /
  7. ;    /_/ /_//_/  /_//___//_/      /_/  /_/
  8. ;
  9. ; $VER 1.1c
  10. ; Changes, suggestions or problems: rcr@netcom.com
  11. ; Installer by Robert C. Reiswig ©1995 
  12. ;******************************************************************************
  13.  
  14. ;*** System Stuff ***
  15. (set cpu (database "cpu"))  (set vblank (database "vblank"))
  16. (set graphmem (database "graphics-mem")) (set totmem (database "total-mem"))
  17. (set osver (/ (getversion "LIBS:version.library") 65536))
  18. (if (= vblank "60") ((set blank "NTSC")) ((set blank "PAL")))
  19. (set fastmem (- totmem graphmem))
  20.  
  21. ( if (= osver 37) ( (set workbench "2.0")) ( if (= osver 38) ( (set workbench "2.1"))
  22. ( if (= osver 39) ( (set workbench "3.0")) ( if (= osver 40) ( (set workbench "3.1"))
  23. ( if (= osver 41) ( (set workbench "4.0")) )))))
  24.  
  25. (set vernum1 (getversion "AmiFTP"))
  26. (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  27. (set amiftpver (cat ver1 "." rev1))
  28.  
  29. ;(if (> (exists ("c:multiview")) 0) (set #mpath "c:") )
  30. ;(if (> (exists ("sys:Utilities/multiview")) 0) (set #mpath "sys:Utilities") )
  31. ;(run (cat "run " (tackon #mpath "multiview ") "magnus.gif"))
  32.  
  33. (set keeper 1) (set prefsfound 0)
  34.  
  35.  
  36. (if (> (exists ("env:Language")) 0) (set lanfound (getenv "Language")) )
  37. (set lan 2)
  38.  
  39. (if (= "dansk"      lanfound) (set lan 0)) (if (= "deutsch"  lanfound) (set lan 1))
  40. (if (= "english"    lanfound) (set lan 2)) (if (= "italiano" lanfound) (set lan 3))
  41. (if (= "nederlands" lanfound) (set lan 4)) (if (= "norsk"    lanfound) (set lan 5))
  42. (if (= "suomi"      lanfound) (set lan 6)) (if (= "svenska"  lanfound) (set lan 7))
  43. (set #Dansk      "Dansk")      (set #Deutsch    "Deutsch")
  44. (set #English    "English")    (set #Italiano   "Italiano")
  45. (set #Nederlands "Nederlands") (set #Norsk      "Norsk")
  46. (set #Suomi      "Suomi")      (set #Svenska    "Svenska")
  47.  
  48. ;********************************************************************
  49. ; English Strings
  50. ;********************************************************************
  51. (set #about (cat "\n\nWelcome to\n\nAmiFTP " amiftpver "\n\n©1995 by\n\nMagnus Lilja\n\nlilja@lysator.liu.se") )
  52. (set #whattcp "\nPlease select the Networking package you run.\n")
  53. (set #whereamiftp "Where do you wish to install AmiFTP. No directory will be created! If there is a copy of AmiFTP there the installer will back it up.")
  54. (set #backuptoXXX "Back-UP to file named 'AmiFTP")
  55. (set #copyover "Copy Over Old Version")
  56. (set #amiftpfound "\nThe Installer has found a copy of AmiFTP already installed. What do you want to do?\n")
  57. (set #newicon "\nDo you wish to copy over The AmiFTP Icon from the archive? If you have any ToolTypes already set you should select no.\n")
  58. (set #nonewicon  "No  - ToolTypes already set.")
  59. (set #yesnewicon "Yes - Copy over Icon.")
  60. (set #whatcat "\nSelect the AmiFTP Language catalog you wish to install..\n")
  61. (set #wherecat "\nWhere do you wish to install the AmiFTP Language Catalog? Default is Locale:Catalogs/")
  62. (set #otherdir "Other Directory")
  63. (set #instdefprefs "Yes - Install Example Prefs File")
  64. (set #instdefprefsn "No  - Don't Install Example Prefs File")
  65. (set #instprefsfile "The installer did not find the AmiFTP.Prefs file in:\n")
  66. (set #wouldprefs "\nWould you like to install an Example Prefs file?")
  67. (set #putprefs "\nWhere would you like to install the AmiFTP.prefs example file?\n")
  68. (set #whatdocs "\nWhat AmiFTP documentation would you like to install?\n")
  69. (set #wheredocs "Where would you like the AmiFTP documentation you selected to be installed?")
  70.  
  71. (set #byebye (cat "\nAmiFTP Install Complete!\n\nIf you wish to make your own Language Catalog "
  72.               "a sample 'NewCatalog.ct' can be found in the 'Catalog' directory in the archive.\n\n"
  73. ))
  74. (set #classact "\n\n\nThe following is the default Install/Update Installer\n\nProcedure for placing ClassAct on you System.")
  75. ;********************************************************************
  76. ; Hello
  77. ;********************************************************************
  78. (message #about)
  79. (welcome) 
  80.  
  81. ;********************************************************************
  82. ; What Networking Package
  83. ;********************************************************************
  84. (set TCP  (askchoice (choices "AmiTCP (3.x, 4.x)" "MultiLink (Mlink)" "AS225r2" "IW225")
  85.                      (prompt #whattcp)
  86.                  (help   #whattcp)
  87.                      (default 0)
  88.       )
  89. )
  90.  
  91. (if (= TCP 0) (set Package "AmiTCP:") )
  92. (if (= TCP 1) (set Package "AmiTCP:") )
  93. (if (= TCP 2) (set Package "Inet:") )
  94. (if (= TCP 3) (set Package "Inet:") )
  95.  
  96. ;********************************************************************
  97. ; Ask where to put AmiFTP 
  98. ;********************************************************************
  99. (set amiftpdir (askdir (prompt #whereamiftp)
  100.                (help   #whereamiftp)
  101.                     (default Package)
  102.                 )  
  103. )
  104.  
  105.  
  106. (set where amiftpdir)
  107. (set @default-dest where)
  108.  
  109. ;********************************************************************
  110. ; Check for old & backup
  111. ;********************************************************************
  112. (if (exists (tackon where "AmiFTP")) 
  113.   (
  114.       (set vernum1 (getversion (tackon where "AmiFTP") ))
  115.       (set ver1 (/ vernum1 65536)) (set rev1 (- vernum1 (* ver1 65536) ) )
  116.       (set amiftpver_old (cat ver1 "." rev1))
  117.  
  118.       (set keeper  (askchoice (choices  (cat #backuptoXXX amiftpver_old "'")  #copyover)
  119.                      (prompt #amiftpfound)
  120.                  (help   #amiftpfound)
  121.                      (default 0)
  122.                )
  123.       )    
  124.  
  125.  
  126.       (if (= keeper 0)
  127.          (copyfiles (source (tackon where "AmiFTP"))
  128.                      (dest where) 
  129.                      (infos)
  130.                      (newname (cat "AmiFTP" amiftpver_old))
  131.          )
  132.       )          
  133.  
  134.     
  135.   )
  136. )
  137.  
  138. ;********************************************************************
  139. ; Copy over correct AmiFTP and Icon if wanted
  140. ;********************************************************************
  141. (if (= TCP 0)
  142.    (copyfiles (source "AmiFTP")
  143.               (dest amiftpdir) 
  144.               (if (= keeper 1) (infos) )
  145.               (optional "askuser" "force" "nofail")
  146.    )
  147.  
  148.  
  149.    ;else
  150.    (copyfiles (source "AmiFTP_as225")
  151.               (dest where) 
  152.               (if (= keeper 1) (infos) )
  153.               (newname "AmiFTP")
  154.               (optional "askuser" "force" "nofail")
  155.    )
  156.  
  157. )   
  158.  
  159.  
  160. (if (= keeper 0) 
  161.   (
  162.    (set newicon (askchoice (choices #nonewicon #yesnewicon)
  163.                            (prompt #newicon)
  164.                        (help   #newicon)
  165.                            (default 0)
  166.             )
  167.    )
  168.    
  169.    (if (= newicon 1) (copyfiles (source "AmiFTP.info") (dest amiftpdir) (optional "nofail") ))
  170.  
  171.  
  172.   )
  173.  
  174. )
  175.  
  176. ;********************************************************************
  177. ; Select and copy over Catalog
  178. ;********************************************************************
  179. (set catalog (askchoice (choices #Dansk #Deutsch #English #Italiano #Nederlands #Norsk #Suomi #Svenska)
  180.                            (prompt #whatcat)
  181.                        (help   #whatcat)
  182.                            (default lan)
  183.              )
  184. )
  185.  
  186. (set lan1 catalog)
  187. (if (= lan1 0) (set #lcat #Dansk     )) (if (= lan1 1) (set #lcat #Deutsch))
  188. (if (= lan1 2) (set #lcat #English   )) (if (= lan1 3) (set #lcat #Italiano))
  189. (if (= lan1 4) (set #lcat #Nederlands)) (if (= lan1 5) (set #lcat #Norsk))
  190. (if (= lan1 6) (set #lcat #Suomi     )) (if (= lan1 7) (set #lcat #Svenska)) 
  191.  
  192.  
  193. (if (<> catalog 2)
  194.  (
  195.   (set wherecat  (askchoice (choices (cat "Locale:Catalogs/" #lcat) (tackon where (cat "Catalogs/" #lcat)) )
  196.                             (prompt (cat #wherecat #lcat "\n"))
  197.                       (help   #wherecat)
  198.                          (default 0)
  199.                  )  
  200.   )
  201.  
  202.  
  203.   (if (= wherecat 0)
  204.     (
  205.      (if (< (exists "Locale:") 2) ( (makedir "sys:Locale") (makeassign "Locale" "sys:Locale") ) )
  206.      (if (< (exists "Locale:Catalogs") 2) (makedir "sys:Locale/Catalogs") )
  207.      (if (< (exists (cat "Locale:Catalogs/" #lcat)) 2) (makedir (cat "sys:Locale/Catalogs/" #lcat)) )
  208.      (copyfiles (source (cat "Catalogs/" #lcat "/AmiFTP.catalog")) (dest (cat "sys:Locale/Catalogs/" #lcat)) )
  209.     )
  210.   
  211.     (
  212.      (if (< (exists (tackon where "Catalogs")) 2) (makedir (tackon where "Catalogs")) )
  213.      (if (< (exists (tackon where (cat "Catalogs/" #lcat)) ) 2) (makedir (tackon where (cat "Catalogs/" #lcat)) ) )
  214.      (copyfiles (source (cat "Catalogs/" #lcat "/AmiFTP.catalog")) (dest (tackon where (cat "Catalogs/" #lcat)) ) (optional "nofail") )
  215.     )
  216.   )
  217.  
  218.  )
  219. )
  220.  
  221. ;********************************************************************
  222. ; See if a Config file is needed
  223. ;********************************************************************
  224. (if (> (exists (tackon where "AmiFTP.prefs")) 0) (set prefsfound 1) )
  225. (set home (getenv "HOME"))    (set ahome (getassign "HOME"))
  226. (if (<> home "") (if (> (exists (tackon home "AmiFTP.prefs")) 0)  (set prefsfound 1) ) )
  227. (if (<> ahome "") (if (> (exists (tackon ahome "AmiFTP.prefs")) 0)  (set prefsfound 1) ) )
  228. (if (> (exists "ENV:AmiFTP.prefs") 0) (set prefsfound 1) )
  229.  
  230. (set #prefscurr where)  (set #prefshome home) 
  231. (set #prefsuser ahome)  (set #prefsenv "ENV:")
  232.  
  233. (if (= prefsfound 0)
  234.  (
  235.    (set defprefs (askchoice (choices  #instdefprefs #instdefprefsn )
  236.                             (prompt (cat #instprefsfile  #prefscurr "\n" #prefshome "\n" #prefsuser "\n" #prefsenv "\n" #wouldprefs))
  237.                         (help   (cat #instprefsfile  #prefscurr "\n" #prefshome "\n" #prefsuser "\n" #prefsenv "\n" #wouldprefs))
  238.                             (default 0)
  239.                  )
  240.    )
  241.  
  242.  
  243.    (if (= defprefs 0)
  244.     (
  245.      (set putprefs (askchoice (choices  "ENV: & ENVARC:" where home ahome)
  246.                              (prompt #putprefs)
  247.                          (help   #putprefs)
  248.                              (default 0)
  249.                  )
  250.      )
  251.  
  252.      (if (= 0 putprefs) 
  253.         (
  254.          (copyfiles (source "AmiFTP2.prefs") (dest "ENV:") (newname "AmiFTP.prefs") )
  255.          (copyfiles (source "AmiFTP2.prefs") (dest "ENVARC:") (newname "AmiFTP.prefs") )
  256.         )  
  257.      )
  258.  
  259.      (if (= 1 putprefs) (copyfiles (source "AmiFTP2.prefs") (dest where) (newname "AmiFTP.prefs") ) )
  260.      (if (= 2 putprefs) (copyfiles (source "AmiFTP2.prefs") (dest home) (newname "AmiFTP.prefs") ) )
  261.      (if (= 3 putprefs) (copyfiles (source "AmiFTP2.prefs") (dest ahome) (newname "AmiFTP.prefs") ) )
  262.  
  263.     )
  264.    )
  265.  
  266.  )
  267. )
  268.  
  269. ;********************************************************************
  270. ; Ask and and copy docs if wanted!
  271. ;********************************************************************
  272. (set docs (askoptions (choices "AmiFTP.guide" "ReadMe" "History")
  273.               (prompt #whatdocs)
  274.                       (help #whatdocs)
  275.                   (default 7)
  276.       )
  277. )
  278.  
  279. (if (<> docs 0)
  280.  (
  281.    (set docsdir (askdir (prompt #wheredocs)
  282.                (help   #wheredocs)
  283.                     (default amiftpdir)
  284.                 )  
  285.    )
  286.  
  287.    (if (IN docs 0) (copyfiles (source "AmiFTP.guide") (dest docsdir) (infos) (optional "nofail") ) )
  288.    (if (IN docs 1) (copyfiles (source "ReadMe") (dest docsdir) (infos) (optional "nofail") ) )
  289.    (if (IN docs 2) (copyfiles (source "HISTORY") (dest docsdir) (infos) (optional "nofail") ) )
  290.  
  291.  )
  292. )
  293.  
  294. ;********************************************************************
  295. ; ClassAct Install/Update Default Procedure by:
  296. ; Osma Ahvenlampi - Osma.Ahvenlampi@hut.fi
  297. ;********************************************************************
  298. ; I have disabled the (complete) settings
  299. (working #classact)
  300.  
  301. ; ---------------------------------------------------------------------------
  302.  
  303. ; ************* PLEASE COPY THIS PROCEDURE ALONG WITH THE STRINGS IT USES 
  304. ; ************* TO THE INSTALLER SCRIPT OF YOUR CLASSACT APPLICATION.
  305. ; ************* IT WILL TAKE CARE OF INSTALLING THE CLASSACT CLASSES YOU
  306. ; ************* PROVIDED WITH YOUR APPLICATION TO THE USER'S SYSTEM.
  307.  
  308. ; ClassAct installation procedure V 1.2 (8.12.95) by Osma Ahvenlampi
  309.  
  310. ; percentage of the size of included ClassAct classes versus the whole
  311. ; distribution (ie. total "complete" percentage after ClassAct is installed)
  312. (set classact-complete 50)
  313.  
  314. ; ClassAct installer scripts
  315. (set #classdest-prompt "Please select the directory where you want the ClassAct classes installed.\n(See help for details)")
  316. (set #classdest-help (cat "ClassAct is a GUI toolkit consisting of shared BOOPSI classes.\n\nThis player requires some of the ClassAct classes installed on your system. "
  317.     (if v39 (cat "OS 3.0 has a standard directory for BOOPSI classes, the SYS:Classes directory. It is recommended that you install ClassAct there.")
  318.             (cat "OS 2.0 does not have a standard place for disk resident BOOPSI classes. On OS 3.0 these classes are stored in the SYS:Classes directory. It is recommended that you create this directory and install ClassAct there.\nThis directory must be added in the LIBS: assign. This can be done by placing the command\nAssign >NIL: LIBS: SYS:Classes ADD\nto User-Startup. This installer will do this for you.")
  319.         )
  320.     )
  321. )
  322. (set #classes-020 "Do you want to use the OS 3.0, 020 optimised version of ClassAct?")
  323. (set #help-020 "Some ClassAct libraries have versions optimised for use on 020 or better equipped OS 3.0 or later machines. If your Amiga is such equipped, you should install these. The 68000/2.0 versions will also work, but are slightly slower.")
  324. (set #noclasses-message "It seems that you do not have a Classes directory.\n\nOne will now be created and added to the LIBS: assign in user-startup. This assign is necessary so that the BOOPSI classes will be found.")
  325. (set #creating-dir "Creating directory ")
  326. (set #usbackup-prompt "User-Startup will now be backed up.")
  327. (set #usbackup-help "This installer will next make a modification in User-Startup. Before doing this the old User-Startup will be backed up to S:User-Startup.old")
  328. (set #adding-1 "Adding ")
  329. (set #adding-2 " to LIBS: assign\n")
  330. (set #adding-help "This is necessary so that the custom classes can be found.")
  331. (set #junod-button "It seems you have a late Commodore 'V42' button.gadget installed on your system.\n\nClassAct's button.gadget is far more capable than this gadget, and we recommend that you replace it. The ClassAct button.gadget is backwards compatible to the Commodore gadget. Do you wish to back up the Commodore gadget and replace it with the ClassAct version?")
  332. (set #junod-backed "The Commodore 'V42' button.gadget has been backed up with the name button.gadget.v42.\n\nThe ClassAct button.gadget will be installed in its place.")
  333. (set #junod-kept "The Commodore 'V42' button.gadget was not replaced with the more capable ClassAct version.\n\nPrograms depending on the availability of ClassAct-only features will be likely to work wrong.")
  334.  
  335. (procedure install-classact
  336. ; call this procedure to copy the classes included in the Classes directory
  337. ; in your distribution dir.
  338.     (if (exists "Classes") ; The archive contains a ClassAct library update.
  339.     (
  340.         (set comp-dest  (/ (* classact-complete 2) 10))
  341.         (set comp-libs  (/ (* classact-complete 3) 10))
  342.         (set comp-dirs  (/ (* classact-complete 4) 10))
  343.         (set comp-junod (/ (* classact-complete 5) 10))
  344.         (set comp-020   (/ (* classact-complete 6) 10))
  345.         (set comp-gad   (/ (* classact-complete 8) 10))
  346.         (set comp-im    (/ (* classact-complete 9) 10))
  347.     
  348.         ; has the user installed ClassAct in CLASSACT: ?
  349.         (set @classact-dest (getassign "CLASSACT" "A"))
  350.         (if (= @classact-dest "") (set @classact-dest "SYS:Classes"))
  351.         
  352.         ; is ClassAct already in SYS:Classes ?
  353.         (if (or (not (exists (tackon @classact-dest "Gadgets/layout.gadget") (noreq)))
  354.                 (= @user-level 2))
  355.             ; no, ask where it should be placed
  356.             (set @classact-dest
  357.                 (askdir
  358.                     (prompt #classdest-prompt)
  359.                     (help #classdest-help)
  360.                     (default @classact-dest)
  361.                     (newpath)
  362.                 )
  363.             )
  364.         )
  365.         
  366.         ;(complete comp-dest)
  367.         
  368.         (if (not (exists @classact-dest))
  369.             (
  370.                 (message #noclasses-message)
  371.                 (makedir @classact-dest (prompt (cat #creating-dir @classact-dest)))
  372.                 (copyfiles
  373.                     (prompt #usbackup-prompt)
  374.                     (help #usbackup-help)
  375.                     (source "S:User-Startup")
  376.                     (dest "S:")
  377.                     (newname "S:User-Startup.old")
  378.                 )
  379.                 (set @addassign (cat "Assign >NIL: LIBS: " @classact-dest " ADD\n"))
  380.                 (startup "CLASSACT" 
  381.                     (command @addassign)
  382.                     (prompt (cat #adding-1 @classact-dest #adding-2))
  383.                     (help #adding-help)
  384.                 )
  385.                 (run (@addassign))
  386.             )
  387.         )
  388.         
  389.         ;(complete comp-libs)
  390.         
  391.         (set @classact-gadgets (tackon @classact-dest "Gadgets"))
  392.         (set @classact-images (tackon @classact-dest "Images"))
  393.         
  394.         (if (not (exists @classact-gadgets (noreq)))
  395.             (makedir @classact-images
  396.                 (prompt (cat #creating-dir @classact-gadgets))
  397.             )
  398.         )
  399.         
  400.         (if (not (exists @classact-images (noreq)))
  401.             (makedir @classact-images
  402.                 (prompt (cat #creating-dir @classact-images))
  403.             )
  404.         )
  405.         
  406.         ;(complete comp-dirs)
  407.         
  408.         (if (exists "SYS:Classes/Gadgets/button.gadget")
  409.             (if (< 40 (/ (getversion "SYS:Classes/Gadgets/button.gadget") 65536))
  410.                 (if (askbool (prompt #junod-button) (help @askbool-help) (default 1))
  411.                     (
  412.                         (rename "SYS:Classes/Gadgets/button.gadget" "SYS:Classes/Gadgets/button.gadget.v42")
  413.                         (message #junod-backed)
  414.                     )
  415.                     (message #junod-kept)
  416.                 )
  417.             )
  418.         )
  419.         
  420.         ;(complete comp-junod)
  421.         
  422.         (if (exists "Classes/Gadgets/layout.gadget.020")
  423.             (set classes-020 (askbool (prompt #classes-020) (help #help-020) (default (and cpu020 v39))))
  424.             (set classes-020 0)
  425.         )
  426.  
  427.         ;(complete comp-020)
  428.         
  429.         (foreach "Classes/Gadgets" "#?.gadget"
  430.             (
  431.                 (set thislib (tackon "Classes/Gadgets" @each-name))
  432.                 (if (and classes-020 (exists (cat thislib ".020")))
  433.                     (set thislib (cat thislib ".020"))
  434.                 )
  435.                 (copylib (source thislib)
  436.                     (dest @classact-gadgets)
  437.                     (newname @each-name)
  438.                     (prompt (cat #installing @each-name))
  439.                     (help #classdest-help)
  440.                     (optional "force" "askuser")
  441.                 )
  442.             )
  443.         )
  444.         
  445.         ;(complete comp-gad)
  446.         
  447.         (foreach "Classes/Images" "#?.image"
  448.             (
  449.                 (set thislib (tackon "Classes/Images" @each-name))
  450.                 (if (and classes-020 (exists (cat thislib ".020")))
  451.                     (set thislib (cat thislib ".020"))
  452.                 )
  453.                 (copylib (source thislib)
  454.                     (dest @classact-images)
  455.                     (newname @each-name)
  456.                     (prompt (cat #installing @each-name))
  457.                     (help #classdest-help)
  458.                     (optional "force" "askuser")
  459.                 )
  460.             )
  461.         )
  462.         
  463.         ;(complete comp-im)
  464.  
  465.         (foreach "Classes" "#?.class"
  466.             (
  467.                 (set thislib (tackon "Classes" @each-name))
  468.                 (if (and classes-020 (exists (cat thislib ".020")))
  469.                     (set thislib (cat thislib ".020"))
  470.                 )
  471.                 (copylib (source thislib)
  472.                     (dest @classact-dest)
  473.                     (newname @each-name)
  474.                     (prompt (cat #installing @each-name))
  475.                     (help #classdest-help)
  476.                     (optional "force" "askuser")
  477.                 )
  478.             )
  479.         )
  480.  
  481.         ;(complete classact-complete)
  482.     )
  483.     )
  484. )
  485.  
  486. ; ************** END OF CLASSACT INSTALL PROCEDURE. COPY THE BLOCK ABOVE
  487. ; ************** TO YOUR CLASSACT APPLICATION INSTALLER.
  488.  
  489. ;Call ClassAct Procedure
  490. (install-classact)
  491.  
  492.  
  493. ;********************************************************************
  494. ; End Bye 
  495. ;********************************************************************
  496. (exit #byebye)
  497.